Ranking and Loopless Generation of k-ary Dyck Words in Cool-lex Order

نویسندگان

  • Stephane Durocher
  • Pak Ching Li
  • Debajyoti Mondal
  • Aaron Williams
چکیده

A binary string B of length n = kt is a k-ary Dyck word if it contains t copies of 1, and the number of 0s in every prefix of B is at most k−1 times the number of 1s. We provide two loopless algorithms for generating k-ary Dyck words in cool-lex order: (1) The first requires two index variables and assumes k is a constant; (2) The second requires t index variables and works for any k. We also efficiently rank k-ary Dyck words in cool-lex order. Our results generalize the “coolCat” algorithm by Ruskey and Williams (Generating balanced parentheses and binary trees by prefix shifts in CATS 2008) and provide the first loopless and ranking applications of the general cool-lex Gray code by Ruskey, Sawada, and Williams (Binary bubble languages and cool-lex order under review).

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Cool-lex order and k-ary Catalan structures

For any given k, the sequence of k-ary Catalan numbers, Ct,k = 1 kt+1 ( kt t ) , enumerates a number of combinatorial objects, including k-ary Dyck words of length n = kt and k-ary trees with t internal nodes. We show that these objects can be efficiently ordered using the same variation of lexicographic order known as cool-lex order. In particular, we provide loopless algorithms that generate ...

متن کامل

Fixed-Density Necklaces and Lyndon Words in Cool-lex Order

This paper creates a simple Gray code for fixed-density binary necklaces and Lyndon words. The Gray code is simultaneously a left-shift Gray code and a 2-transposition Gray code and is cyclic with these properties. It also has the advantage of using canonical representations (lexicographically minimum rotations) yielding the first known Gray code for Lyndon words ordered by density. This work s...

متن کامل

Efficient Oracles for Generating Binary Bubble Languages

Given a string α = 10γ in a binary language L, the bubble lower bound is the smallest non-negative integer j such that 1s−10t−j10jγ ∈ L. We present an efficient oracle, which is a function that returns the bubble lower bound, for a number of fixed-density languages including: k-ary Dyck words, connected unit interval graphs, linear-extensions ofB-posets, those lexicographically larger than ω, t...

متن کامل

Binary bubble languages and cool-lex order

A bubble language is a set of binary strings with a simple closure property: The first 01 of any string can be replaced by 10 to obtain another string in the set. Natural representations of many combinatorial objects are bubble languages. Examples include binary string representations of k-ary trees, unit interval graphs, linear-extensions of B-posets, binary necklaces and Lyndon words, and fea...

متن کامل

Parallel Generation of t-ary Trees

A parallel algorithm for generating t-ary tree sequences in reverse B-order is presented. The algorithm generates t-ary trees by 0-1 sequences, and each 0-1 sequences is generated in constant average time O(1). The algorithm is executed on a CREW SM SIMD model, and is adaptive and cost-optimal. Prior to the discussion of the parallel algorithm a new sequential generation with O(1) average time ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2011